﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Freejobber.UserControls
{
    public partial class TextBox : System.Web.UI.UserControl
    {
        private bool isEditing = false;
        private bool enabled = true;
        private Unit width = 0;
        private string text = "";
        private Color color;

        public bool Enabled
        {
            get { return Textplace.Enabled; }
            set { Textplace.Enabled = value; }
        }

        public Color InnerColor
        {
            get
            {
                if (color.Name == "0")
                {
                    color = Color.Aqua;
                }
                return color; 
            }
            set
            {
                color = value;
                
            }
        }

        public string Text
        {
            get { return Textplace.Text; }
            set 
            { 
                text = value;
                Textplace.Text = value;
            }
        }
        public Unit Width
        {
            get { return width; }
            set 
            {
                width = value;
                Textplace.Width=value;
            }
        }

        public bool IsEditing
        {
            get { return isEditing; }
            set 
            { 
                isEditing = value;
                Textplace.ReadOnly = !value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            Input.Style["background-color"] = InnerColor.Name;
        }
    }
}